#pragma once

#include <iostream>

#include "Vec2.h"

class Trajectory
{
public:
	Trajectory(void);
	~Trajectory(void);

	// Renders the Shape with OpenGL
	void render() const;

	// Updates the next vertex
	void updateNextVertex(const Vec2& nueva_posicion);

	// Adds the current vertex (_nextVertex) to the Shape
	void addNextVertex();

	// Returns the num-th vertex
	const Vec2& vertex(unsigned int num) const;

	// Returns the number of vertices
	unsigned int nVertices() const;

	// Save the Shape. 
	void save( std::ostream& output);

	// Loads the Shape. 
	void load( std::istream& input);

	void deleteAll();
	void setColor(float red, float green, float blue);
	void deleteLastVertex();

private:
	void addStartVertex();


private:
	Vec2 _nextVertex; // Next vertex to be added
	VectorVec2 _vertices; // Vector of vertices in the traj

	float redCol, greenCol, blueCol; // Colors
};
